package com.gupaoedu.task.pattern.proxy.jdk;

import java.lang.reflect.Method;

public class StarNewProxyTest {
    public static void main(String[] args) {
        try{
            Object obj = new StarNewProxy().getInstance(new Stars("刘诗诗"));
            Method method =obj.getClass().getMethod("dance", null);
            method.invoke(obj);
            obj = new StarNewProxy().getInstance(new Stars("韩红"));
            method =obj.getClass().getMethod("sing", null);
            method.invoke(obj);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
